﻿using System;
using System.Linq;

using Fuse8.DomainFramework.Domain;
using Fuse8.DomainFramework.Common;

using Fuse8.ContentManagementFramework.Domain.Commands.CommandParameters;

namespace Fuse8.ContentManagementFramework.Domain.Commands
{
    public abstract class CmsPageFrontEndCommand : BaseEntityParameterCommand<CmsPage, CmsPageFrontEndCommandParameter>
    {        
        #region IEntityCommand<CmsPage> Members

        public override string CacheKey
        {
            get 
            {
                return string.Format("Url_{0}_SiteGroup_{1}_Site_{2}", 
                    CommandParameter.PageUrl, 
                    CommandParameter.SiteGroupId.GetValueOrDefault(0), 
                    CommandParameter.SiteId.GetValueOrDefault(0));
            }
        }

        public override string CommandName
        {
            get 
            {
                return "CmsPageFrontEndCommand";
            }
        }

        #endregion
    }
}
